package com.xing.math;

public class Demo13 {
    public static void main(String[] args) {
        int card=2836;

        int a=card/1000;   //2
        int b=card/100%10; //8
        int c=card/10%10;  //3
        int d=card%10;   //6

        int x=a+b+c+d;

        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);

        System.out.println(x);
    }
}
